<!DOCTYPE html>
<html lang="zn-CN">
<head>
    <meta charset="UTF-8">
    <title>SWPU IP监控系统</title>
    <link rel="stylesheet" href="static/layui/css/layui.css">
    <script src="static/layui/layui.js"></script>
    <link rel="shortcut icon" href="static/picture/swpu02.ico" />
</head>

<body>

<div class="layui-card">
    <div class="layui-card-body">
        <table id="ipTable" lay-filter="ipTable"></table>
    </div>
</div>

<script type="text/javascript">
    layui.use(['table', 'jquery', 'layer'], function () {
        var table = layui.table;
        var $ = layui.jquery;
        var layer = layui.layer;
        table.render({
            elem: '#ipTable'
            , url: '/ip/listIpMessage'
            , limit: 11
            , defaultToolbar: 'default'
            //, height: 650
            , totalRow: true
            , title: 'IP监控'
            , cols: [[
                {field: 'ipv4_SRC_ADDR', title: 'IPV4_SRC_ADDR', width: 160},
                {field: 'ipv4_DST_ADDR', title: 'IPV4_DST_ADDR', width: 160},
                {field: 'input_SNMP', title: 'INPUT_SNMP', width: 160,},
                {field: 'output_SNMP', title: 'OUTPUT_SNMP', width: 160},
                {field: 'in_PKTS', title: 'IN_PKTS', width: 160},
                {field: 'in_BYTES', title: 'IN_BYTES', width: 160},
                {field: 'first_SWITCHED', title: 'FIRST_SWITCHED', width: 160},
                {field: 'last_SWITCHED', title: 'LAST_SWITCHED', width: 160},
                {field: 'l4_SRC_PORT', title: 'L4_SRC_PORT', width: 160},
                {field: 'l4_DST_PORT', title: 'L4_DST_PORT', width: 160},
                {field: 'tcp_FLAGS', title: 'TCP_FLAGS', width: 160},
                {field: 'protocol', title: 'PROTOCOL', width: 160},
                {field: 'src_TOS', title: 'SRC_TOS', width: 160},
                {field: 'src_AS', title: 'SRC_AS', width: 160},
                {field: 'dst_AS', title: 'DST_AS', width: 160}
            ]],
            request: {      //解决前端参数名字和我们设置的不符合问题
                pageName: "currentPage",
                limitName: "pageSize"
            },
            parseData: function (res) {
                console.log(res);
                return {
                    "code": 0,
                    "msg": res.msg,
                    "count": res.data.totalCount,
                    "data": res.data.data
                }
            },
            page: true
        });

    })
</script>
</body>
</html>